// Sort theArray[first...last] by
//  1.Sorting the first half of the array
//  2.Sorting the second half of the array
//  3.Merging the two sorted halves
mergeSort(theArray: ItemArray, first: integer,last: integer)

    if (first < last)
    {
        mergeSort();
        mergeSort();
        merge();
    }